//
//  MenuBarCell.m
//  share_business
//
//  Created by baidufz on 2017/9/8.
//  Copyright © 2017年 wyl. All rights reserved.
//

#import "MenuBarCell.h"
#import "MenuCell.h"

@implementation MenuBarCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setup:(NSArray *)array {
    int width = self.bounds.size.width / 4;
    int height = self.bounds.size.height - 2;
    
    for (int i = 0; i < array.count; i++) {
        MenuCell *cell = [[MenuCell alloc]initWithFrame:CGRectMake(width * i, 0, width, height)];
        [cell setMenu:[UIImage imageNamed:[[array objectAtIndex:i] objectAtIndex:1]] name: [[array objectAtIndex:i] objectAtIndex:0]];
        [cell setClickCallback:[[array objectAtIndex:i] objectAtIndex:2]];
        [self addSubview:cell];
    }
}

@end
